package common;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Igor Demidov
 * Date: 25.02.13
 * Time: 14:39
 */
public class Folder implements Serializable {
    private String name;
    private List<Email> emails;

    public Folder(String name) {
        this.name = name;
        emails = new LinkedList<Email>();
    }

    public String getName() {
        return name;
    }

    public void rename(String newName) {
        this.name = newName;
    }

    public List<Email> getEmails() {
        return emails;
    }

    public void addEmail(Email email) {
        emails.add(email);
    }

    public void removeEmail(Email email) {
        emails.remove(email);
    }
}
